package com.xqb.modules.domain.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xqb.common.annotation.Excel;
import com.xqb.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 优惠券的规则信息对象 mkt_coupon
 * 
 * @author xqb
 * @date 2024-10-15
 */
public class MktCoupon extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 优惠券id */
    private Long id;

    /** 优惠券名称，可以和活动名称保持一致 */
    @Excel(name = "优惠券名称，可以和活动名称保持一致")
    private String name;

    /** 优惠券类型，1：普通券。目前就一种，保留字段 */
    @Excel(name = "优惠券类型，1：普通券。目前就一种，保留字段")
    private Long type;

    /** 折扣类型，1：满减，2：每满减，3：折扣，4：无门槛 */
    @Excel(name = "折扣类型，1：满减，2：每满减，3：折扣，4：无门槛")
    private Long discountType;

    /**
     * 是否限定作用范围，false：不限定，true：限定。默认false
     */
    @Excel(name = "是否限定作用范围，false：不限定，true：限定。默认false")
    private Integer specificScope;

    /** 折扣值，如果是满减则存满减金额，如果是折扣，则存折扣率，8折就是存80 */
    @Excel(name = "折扣值，如果是满减则存满减金额，如果是折扣，则存折扣率，8折就是存80")
    private Long discountValue;

    /** 使用门槛，0：表示无门槛，其他值：最低消费金额 */
    @Excel(name = "使用门槛，0：表示无门槛，其他值：最低消费金额")
    private Long thresholdAmount;

    /** 最高优惠金额，满减最大，0：表示没有限制，不为0，则表示该券有金额的限制 */
    @Excel(name = "最高优惠金额，满减最大，0：表示没有限制，不为0，则表示该券有金额的限制")
    private Long maxDiscountAmount;

    /** 获取方式：1：手动领取，2：兑换码 */
    @Excel(name = "获取方式：1：手动领取，2：兑换码")
    private Long obtainWay;

    /** 开始发放时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始发放时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date issueBeginTime;

    /** 结束发放时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束发放时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date issueEndTime;

    /** 优惠券有效期天数，0：表示有效期是指定有效期的 */
    @Excel(name = "优惠券有效期天数，0：表示有效期是指定有效期的")
    private Long termDays;

    /** 优惠券有效期开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "优惠券有效期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date termBeginTime;

    /** 优惠券有效期结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "优惠券有效期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date termEndTime;

    /** 优惠券配置状态，1：待发放，2：未开始   3：进行中，4：已结束，5：暂停 */
    @Excel(name = "优惠券配置状态，1：待发放，2：未开始   3：进行中，4：已结束，5：暂停")
    private Long status;

    /** 总数量，不超过5000 */
    @Excel(name = "总数量，不超过5000")
    private Long totalNum;

    /** 已发行数量，用于判断是否超发 */
    @Excel(name = "已发行数量，用于判断是否超发")
    private Long issueNum;

    /** 已使用数量 */
    @Excel(name = "已使用数量")
    private Long usedNum;

    /** 每个人限领的数量，默认1 */
    @Excel(name = "每个人限领的数量，默认1")
    private Long userLimit;

    /** 拓展参数字段，保留字段 */
    @Excel(name = "拓展参数字段，保留字段")
    private String extParam;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }
    public void setType(Long type) 
    {
        this.type = type;
    }

    public Long getType() 
    {
        return type;
    }
    public void setDiscountType(Long discountType) 
    {
        this.discountType = discountType;
    }

    public Long getDiscountType() {
        return discountType;
    }

    public Integer getSpecificScope() {
        return specificScope;
    }

    public void setSpecificScope(Integer specific) {
        this.specificScope = specific;
    }

    public void setDiscountValue(Long discountValue) {
        this.discountValue = discountValue;
    }

    public Long getDiscountValue() 
    {
        return discountValue;
    }
    public void setThresholdAmount(Long thresholdAmount) 
    {
        this.thresholdAmount = thresholdAmount;
    }

    public Long getThresholdAmount() 
    {
        return thresholdAmount;
    }
    public void setMaxDiscountAmount(Long maxDiscountAmount) 
    {
        this.maxDiscountAmount = maxDiscountAmount;
    }

    public Long getMaxDiscountAmount() 
    {
        return maxDiscountAmount;
    }
    public void setObtainWay(Long obtainWay) 
    {
        this.obtainWay = obtainWay;
    }

    public Long getObtainWay() 
    {
        return obtainWay;
    }
    public void setIssueBeginTime(Date issueBeginTime) 
    {
        this.issueBeginTime = issueBeginTime;
    }

    public Date getIssueBeginTime() 
    {
        return issueBeginTime;
    }
    public void setIssueEndTime(Date issueEndTime) 
    {
        this.issueEndTime = issueEndTime;
    }

    public Date getIssueEndTime() 
    {
        return issueEndTime;
    }
    public void setTermDays(Long termDays) 
    {
        this.termDays = termDays;
    }

    public Long getTermDays() 
    {
        return termDays;
    }
    public void setTermBeginTime(Date termBeginTime) 
    {
        this.termBeginTime = termBeginTime;
    }

    public Date getTermBeginTime() 
    {
        return termBeginTime;
    }
    public void setTermEndTime(Date termEndTime) 
    {
        this.termEndTime = termEndTime;
    }

    public Date getTermEndTime() 
    {
        return termEndTime;
    }
    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }
    public void setTotalNum(Long totalNum) 
    {
        this.totalNum = totalNum;
    }

    public Long getTotalNum() 
    {
        return totalNum;
    }
    public void setIssueNum(Long issueNum) 
    {
        this.issueNum = issueNum;
    }

    public Long getIssueNum() 
    {
        return issueNum;
    }
    public void setUsedNum(Long usedNum) 
    {
        this.usedNum = usedNum;
    }

    public Long getUsedNum() 
    {
        return usedNum;
    }
    public void setUserLimit(Long userLimit) 
    {
        this.userLimit = userLimit;
    }

    public Long getUserLimit() 
    {
        return userLimit;
    }
    public void setExtParam(String extParam) 
    {
        this.extParam = extParam;
    }

    public String getExtParam() 
    {
        return extParam;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("type", getType())
                .append("discountType", getDiscountType())
                .append("specificScope", getSpecificScope())
            .append("discountValue", getDiscountValue())
            .append("thresholdAmount", getThresholdAmount())
            .append("maxDiscountAmount", getMaxDiscountAmount())
            .append("obtainWay", getObtainWay())
            .append("issueBeginTime", getIssueBeginTime())
            .append("issueEndTime", getIssueEndTime())
            .append("termDays", getTermDays())
            .append("termBeginTime", getTermBeginTime())
            .append("termEndTime", getTermEndTime())
            .append("status", getStatus())
            .append("totalNum", getTotalNum())
            .append("issueNum", getIssueNum())
            .append("usedNum", getUsedNum())
            .append("userLimit", getUserLimit())
            .append("extParam", getExtParam())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .toString();
    }
}
